/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pwfkasse;

import java.io.*;
import pwfkasse.logik.Mitarbeiter;

/**
 *
 * @author Stefan
 */
public class TestKlasse {

    public static void main(String[] args) {

        Mitarbeiter verena = new Mitarbeiter("Verena", "Neuhaus", 1, "neuhaus@pwf-paderborn.de", 10, "12.06.80");
//        verena.display(verena);
//        
//        System.out.println("");
//        
//        Kunde schoof = new Kunde("Schoof", "STefan", "Am Beispring", 42, "Bad Lippspringe", 33175, "05252-938333", "05252-938333", 
//        "schoof@pwf-paderborn.de", 1, "08.10.08", "11.02.1971", 10.00, 25.00, 0.00, 100.00);
//        
//        schoof.display();

        try {
            ObjectOutputStream oout = new ObjectOutputStream(
                    new BufferedOutputStream(
                    new FileOutputStream("Mitarbeiter.dat")));
            oout.writeObject(verena);
            oout.close();
            ObjectInputStream oin = new ObjectInputStream(new BufferedInputStream(
                    new FileInputStream("Mitarbeiter.dat")));
            boolean eof = false;
            while (!eof) {
                Mitarbeiter neuerMA = (Mitarbeiter) oin.readObject();
                neuerMA.display();
            }
            oin.close();
        } catch (EOFException e) {
            System.out.println("Dateiende!");
        } catch (FileNotFoundException e) {
            System.out.println("FNF EXC");
        } catch (IOException e) {
            System.out.println("IO EXC");
        } catch (ClassNotFoundException e) {
            System.out.println("CNF EXC");
        }finally {
            System.out.println("ende ");
        }




       


    }
}
